#pragma once

#include <QWidget>
#include <QMessageBox>
#include <qmenu.h>
#include <qmenubar.h>
#include <qfiledialog.h>
#include "ui_page1.h"
#include "MyData.h"
#include "SportMeeting.h"
class SportMeeting;
class page1 : public QWidget
{
	Q_OBJECT

public:
	page1(QWidget *parent = nullptr);
	~page1();
	void setBoyItems();
	void setGirlItems();
	void setTeams();
	bool judgeEmpty(int n1,int n2,int n3);
	void loadDate();
	bool judge();
	friend void message(QString title, QString text, QMessageBox::Icon, QMessageBox::Button, QWidget* parent);
	friend void setPage(SportMeeting* sportMeeting,QWidget*);
	
private:
	Ui::page1Class ui;
	MyData* myData;
	SportMeeting* parent;
	QMenu menu;
	QAction* delActionItem;
	QAction* addActionItem;
	QListWidget* curListWidget;
	bool hasReadFile;
private slots:
	bool update();
	void showContextMenu1(const QPoint& pos);
	void showContextMenu2(const QPoint& pos);
	void showContextMenu3(const QPoint& pos);
	void deleteItem();
	void addItem();
	void admit();
	void openJsonFile();
};
